home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FM Towns: Free Software Collection 10
/
FM Towns Free Software Collection 10.iso
/
taropyon
/
edia
/
ccisrc
/
lib.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-11-07
|
1KB
|
52 lines
/*************************************************************************
* 時間表記
*************************************************************************/
#ifndef TM_SEC
#define TM_SEC(tm) (tm[0]) /* 0...59 */
#define TM_MIN(tm) (tm[1]) /* 0...59 */
#define TM_HOUR(tm) (tm[2]) /* 0...23 */
#define TM_MDAY(tm) (tm[3]) /* 1...31 */
#define TM_MON(tm) (tm[4]) /* 0...11 */
#define TM_YEAR(tm) (tm[5]) /* 1900... */
#define TM_WDAY(tm) (tm[6]) /* Sunday 0...6 */
#define TM_YDAY(tm) (tm[7]) /* 0...365 */
#define TM_ISDST(tm) (tm[8]) /* daylight */
#endif
char *GetAsciiTime( char *s, long t )
{
int *tm;
tm = localtime( &t );
sprintf( s, "%04d/%02d/%02d %02d:%02d",
TM_YEAR(tm)+1900, TM_MON(tm)+1, TM_MDAY(tm),
TM_HOUR(tm), TM_MIN(tm) );
return (s);
}
int TxdUsr_saveColTbl( char *txd )
{
int ret;
char *fdl;
char tmp[128], *fn;
if ( (fdl = FDL_open(0)) == NULL )
return (ERR);
FDL_set_wildcard( fdl, "*.tbl");
FDL_set_title( fdl, "SAVE COLOR TABLE");
ret = FDL_start(fdl);
fn = FDL_get_filename(fdl);
if ( ret != NORMAL || strlen(fn) == 0 )
{
FDL_close(fdl);
return (ERR);
}
FS_appendSnam( tmp, fn, ".tbl");
TXD_saveColTbl(txd,tmp);
FDL_close(fdl);
return (NORMAL);
}